﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    //Description:	Checks if a string value is numeric according to you system culture.
    /*
        string value = "abc";
        bool isnumeric = value.IsNumeric();// Will return false;
        value = "11";
        isnumeric = value.IsNumeric();// Will return true;
    */

    public static partial class StringExtensions
    {
        public static bool IsNumeric(this string theValue)
        {
            long retNum;
            return long.TryParse(theValue, System.Globalization.NumberStyles.Integer, System.Globalization.NumberFormatInfo.InvariantInfo, out retNum);
        }
    }
}
